//
// Created by liushuai on 2021/1/12.
//

#include "missingNumber.h"
<<<<<<< HEAD:cxx/algorithm/src/missingNumber.cc
#include <vector>
int missingNumber(std::vector<int>& nums){
    int nums_size = nums.size();
    int lower = 0;
    int upper = nums_size-1;
    while(lower<=upper){
        int mid = (upper+lower)/2;
        if(nums[mid]== mid)
            lower = mid+1;
        else
            upper = mid-1;
    }
    return lower;
=======

#include <vector>
int missingNumber(std::vector<int>& nums) {
  int nums_size = nums.size();
  int lower = 0;
  int upper = nums_size - 1;
  while (lower <= upper) {
    int mid = (upper + lower) / 2;
    if (nums[mid] == mid)
      lower = mid + 1;
    else
      upper = mid - 1;
  }
  return lower;
>>>>>>> dev:cxx/algorithm/common/src/missingNumber.cc
}